import json, win32gui


def task():
    windows = []
    def get_all_hwnd(hwnd,mouse):
        if win32gui.IsWindow(hwnd) and win32gui.IsWindowEnabled(hwnd) and win32gui.IsWindowVisible(hwnd):
            title = win32gui.GetWindowText(hwnd)
            if title != '':
                windows.append({
                    'hwnd': hwnd,
                    'title': title,
                })
    win32gui.EnumWindows(get_all_hwnd, 0)
    return json.dumps(windows, ensure_ascii=False)